package com.bd.module.salegood.ui;

import javax.swing.*;
import java.awt.*;
import javax.swing.border.*;

/**
 * 此类作为table的面板类，包括：table标签面板，table面板
 *
 */
public class EDialogTablePanel extends JPanel {
	private JPanel labelPanel;
	private JPanel tablePanel;
	private JLabel jLabel;
	private JScrollPane jScrollPane;
	protected JTable table;
	
	public EDialogTablePanel(EDialogTableModel dataModel){
		labelPanel = new JPanel(new FlowLayout());
		tablePanel = new JPanel(new BorderLayout());
		
		this.setLayout(new BorderLayout());
		this.setBorder(BorderFactory.createEtchedBorder());
		
		jLabel = new JLabel("交易信息");
		labelPanel.add(jLabel);
		this.add(labelPanel,BorderLayout.NORTH);
		
		table = new JTable();
		table.setModel(dataModel);
		jScrollPane = new JScrollPane();
		jScrollPane.getViewport().add(table,null);
		tablePanel.add(jScrollPane);
		this.add(tablePanel,BorderLayout.CENTER);
	}
}
